package com.vichat.api.vo;

import com.vichat.common.util.NumberUtils;

import java.util.List;

/**
 * Created by wangluyin on 2017/12/21.
 */
public class RoomUser {
    public long rid;
    public long partyId;

    public Long getPartyId() {
        return partyId;
    }

    public void setPartyId(Long partyId) {
        this.partyId = partyId;
    }

    public List<User> users;

    public long getRid() {
        return rid;
    }

    public void setRid(long rid) {
        this.rid = rid;
    }

    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    public void setErrorResultCode() {
        this.resultCode = "0099";
    }

    public String getResultMsg() {
        return resultMsg;
    }

    public void setResultMsg(String resultMsg) {
        this.resultMsg = resultMsg;
    }

    public String resultCode = "0000";
    public String resultMsg;


    public void setPartyId(long partyId) {
        this.partyId = partyId;
    }

    public List<User> getUsers() {
        return users;
    }

    public void setUsers(List<User> users) {
        this.users = users;
    }


    public void check() throws Exception {
        if (NumberUtils.isNullOrZero(this.getPartyId())) {
            throw new Exception("缺少参数partyId");
        }
        if (NumberUtils.isNullOrZero(this.getRid())) {
            throw new Exception("缺少参数roomId");
        }
        if (this.getUsers() == null || this.getUsers().size() == 0) {
            throw new Exception("缺少参数users");
        }
    }
}
